package body ppila is

   procedure pbuida(p:out pila) is
   begin
      p:= null;
   end pbuida;


   procedure empila(p:in out pila; e:in element) is
      q: pila:= new bloc;
   begin
      q.all.e:= e;
      q.all.s:= p;
      p:= q;
   end empila;


   function cim (P:in Pila) return element is
   begin
      if P=null then
         raise Desb_Sup;
      else
         return P.all.E;
      end if;
   exception
      when Desb_Sup => return p.all.e;
   end Cim;

   procedure Desempila(P:in out Pila) is
   begin
      if P=null then
         raise Desb_Inf;
      else
         P:=P.all.S;
      end if;
   exception
      when Desb_Inf => null;
   end Desempila;

   function Esbuida(P:in Pila) return Boolean is
   begin
      if P=null then return True;
      else return False;
      end if;
   end Esbuida;
end D_Pila;


